package com.my.launcher.constant;

/**
 * @author timo 2021/2/6
 */
public interface NacosConstant {
    public static final String NACOS_CONFIG_PREFIX = "blade";
    public static final String NACOS_GROUP_SUFFIX = "-group";
    public static final String NACOS_CONFIG_FORMAT = "yaml";
    public static final String NACOS_CONFIG_JSON_FORMAT = "json";
    public static final String NACOS_CONFIG_REFRESH = "true";
    public static final String NACOS_CONFIG_GROUP = "DEFAULT_GROUP";
    public static final String NACOS_SEATA_GROUP = "SEATA_GROUP";
    public static final String DEV_CODE = "dev";
    public static final String PROD_CODE = "prod";
    public static final String TEST_CODE = "test";

    static String dataId(final String appName, final String profile) {
        return dataId(appName, profile, "yaml");
    }

    static String dataId(final String appName, final String profile, final String format) {
        return appName + "-" + profile + "." + format;
    }

    static String sharedDataIds(final String profile) {
        return   profile + "." + "yaml";
    }
}
